import Vue from 'vue'
import Vuex from 'vuex'
import Wodem from "./modules/wode.js"//引用模块

Vue.use(Vuex)
import getlink from "@/apis/getapi.js"
export default new Vuex.Store({
  state: {
    arr:[],
    text:"修改state"
  },
  mutations: {
    uparr(state,payload){
      state.arr=payload.p
      console.log(state.arr)
    },
    uptext(state,payload){
    state.text=payload.newtext
    }

  },
  actions: {
  getaxios(context,payload){
    console.log(context);
    getlink(payload.url).then((ok)=>{//发送异步请求
      console.log(ok.data.data);
    context.commit("uparr",{p:ok.data.data})
    })

  }

  },
  modules: {
    Wodem
  }
})
